package com.etnet.streamserver.format.impl;

import au.com.bytecode.opencsv.CSVWriter;
import com.etnet.streamserver.format.IFormatter;
import java.io.StringWriter;
import java.util.List;

public class ArrayCSVFormatter implements IFormatter<String[]> {
    public String format(List<String[]> list) {
        StringWriter stringWriter = new StringWriter();
        CSVWriter csvWriter = new CSVWriter(stringWriter);
        for (String[] strs : list) {
            csvWriter.writeNext(strs);
        }
        return stringWriter.toString();
    }
}